<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>
    <title>兼职界面--约单</title>
    <link rel="stylesheet" href="../css/base.css"/>
    <link rel="stylesheet" href="../css/mui.min.css"/>
    <link rel="stylesheet" href="../css/mui_img.css"/>
    <link rel="stylesheet" href="../css/footer.css"/>
    <link rel="stylesheet" href="../css/slider_left.css"/>
    <link rel="stylesheet" href="../css/work.css"/>


    <style>

    </style>
</head>
<body>
<div id="loading">
    <img src="../img/login.gif" alt=""/>
    <div>请等待，正在加载...</div>
</div>
<div id="content_layer">
    <!--侧滑部分-->
    <div id="left">
        <div class="header">
            <!--信息-->
            <!--<img src="../img/focus-img1.png" alt="" onclick="location.href='./head.html'"/>
            <div class="center">
                <em>七月的雪</em>
                <span onclick="location.href='./simple_abstruct.html'">待到山花烂漫时，她在丛中笑待到山花烂漫时，她在丛中笑待到山花烂漫时，她在丛中笑</span>
            </div>-->
        </div>
        <ul class="scroll">
            <li class="mui-table-view-cell">
                <a href="./my_purse.html" class="mui-navigate-right"> <i></i>&nbsp;&nbsp;&nbsp;&nbsp;钱包</a>
            </li>
            <li class="mui-table-view-cell">
                <a href="./my_post.html" class="mui-navigate-right"> <i></i>&nbsp;&nbsp;&nbsp;&nbsp;发布的帖子</a>
            </li>
            <li class="mui-table-view-cell">
                <a href="./my_market.html" class="mui-navigate-right"> <i></i>&nbsp;&nbsp;&nbsp;&nbsp;市场中心</a>
            </li>
            <li class="mui-table-view-cell">
                <a href="./my_employ.html" class="mui-navigate-right"> <i></i>&nbsp;&nbsp;&nbsp;&nbsp;应聘信息</a>
            </li>
            <li class="mui-table-view-cell">
                <a href="./seting.html" class="mui-navigate-right"> <i></i>&nbsp;&nbsp;&nbsp;&nbsp;设置</a>
            </li>
            <li class="mui-table-view-cell">
            </li>
            <li class="mui-table-view-cell">
            </li>
            <li class="mui-table-view-cell">
            </li>
            <li class="mui-table-view-cell">
            </li>
            <li class="mui-table-view-cell">
            </li>
            <li class="mui-table-view-cell">
            </li>
            <li class="mui-table-view-cell">
            </li>
            <li class="mui-table-view-cell">
            </li>
        </ul>
    </div>
    <div id="mask"></div>
    <div class="layer work_layer" id="layer">
        <header id="topbar" style="overflow: hidden">
            <div class="img_box" id="show">
                <!--填充-->
            </div>
            <div class="header_right">
                <em class="city">郑州</em>
                <!--<select name="" id="">
                    <option value="place" selected>郑州</option>
                </select>-->
                <input type="text" placeholder= "搜索职位" id="search" name="search" required/>
            </div>
        </header>
        <div id="slider" class="mui-slider" >
            <div class="mui-slider-group mui-slider-loop">
                <!-- 额外增加的一个节点(循环轮播：第一个节点是最后一张轮播) -->
                <div class="mui-slider-item mui-slider-item-duplicate">
                    <a href="#">
                        <img src="../img/1.jpg">
                    </a>
                </div>
                <!-- 第一张 -->
                <div class="mui-slider-item">
                    <a href="#">
                        <img src="../img/1.jpg">
                    </a>
                </div>
                <!-- 第二张 -->
                <div class="mui-slider-item">
                    <a href="#">
                        <img src="../img/1.jpg">
                    </a>
                </div>
                <!-- 第三张 -->
                <div class="mui-slider-item">
                    <a href="#">
                        <img src="../img/1.jpg">
                    </a>
                </div>

                <!-- 额外增加的一个节点(循环轮播：最后一个节点是第一张轮播) -->
                <div class="mui-slider-item mui-slider-item-duplicate">
                    <a href="#">
                        <img src="../img/1.jpg">
                    </a>
                </div>
            </div>
            <div class="mui-slider-indicator">
                <div class="mui-indicator mui-active"></div>
                <div class="mui-indicator"></div>
                <div class="mui-indicator"></div>
            </div>
        </div>
        <div class="nav">
            <ul>
                <li>
                    <a href="./work.html">兼职</a>
                </li>
                <li>
                    <a href="work_sigle.html"  class="active">约单</a>
                </li>
            </ul>
        </div>
        <div class="main_content">
            <ul>
                <!--填充-->
<!--  <li>
                   <em></em>
                   <span>123456</span>
               </li>
               <li>
                   <em></em>
                   <span>23456</span>
               </li>-->

            </ul>
        </div>

        <footer>
            <ul class="clearfix">
                <li class="clearfix" onclick="location.href='./news.html'">
                    <i></i>
                    <em>资讯</em>
                </li>
                <li class="clearfix" onclick="location.href='./community.html'">
                    <i></i>
                    <em>社区</em>
                </li>
                <li class="clearfix" onclick="location.href='./publish.html'">
                    <i></i>

                </li>
                <li class="clearfix" onclick="location.href='./business.html'">
                    <i></i>
                    <em>交易</em>
                </li>
                <li class="clearfix" onclick="location.href='./work.html'">
                    <i></i>
                    <em>兼职</em>
                </li>
            </ul>
        </footer>
    </div>
</div>
</body>
<script src="../js/x_rem.js"></script>
<script src="../js/mui.min.js"></script>
<script src="../js/mui.zoom.js"></script>
<script src="../js/mui.preview.js"></script>
<script src="../js/base.js"></script>
<script src="../js/jquery.js"></script>
<script src="../js/left_slider.js"></script>
<script src="../js/template-web.js"></script>
<script src="../js/template.js"></script>
<script id="getPic" type="text/html">
    {{if message=="" || !message}}
    <img  src="../img/focus-img1.png" >
    {{else}}
    <img  src="{{message}}" onerror="this.src='../img/focus-img1.png'">
    {{/if}}

</script>
<script id="userInfo" type="text/html">
    {{if avatar==null}}
    <img src="../img/focus-img1.png" alt="" onclick="location.href='./head.html'"/>
    {{else}}
    <img src="{{avatar}}" alt="" onclick="location.href='./head.html'"/>
    {{/if}}
    <div class="center">
        {{if userName==null }}
        <em>{{realName}}</em>
        {{else}}
        <em>{{userName}}</em>
        {{/if}}
        <span onclick="location.href='./simple_abstruct.html'">{{motto==""||motto==null?"此人很懒，暂时没有简介！":motto}}</span>
    </div>
</script>
<script id="work_sigle" type="text/html">
   {{each list as value i}}
   <li>
       {{if value.pusher==null}}
       <div class="top"> 该用户展示没有信息展示</div>
       {{else}}
       <div class="top">
                      <span  onclick="location.href='./other_information.html'">
                          <img src="{{value.pusher.avatar}}" alt=""/>
                        <em>{{value.pusher.realName}}</em>
                      </span>
           <i><!--0.2km. -->{{time(value.pushTime)}} </i>
       </div>
       {{/if}}
       <div class="middle" onclick="location.href='./work_job_single.html?partnerId={{value.partnerId}}'">
           {{each str(value.imagePath) as img j}}
           <div class="img_box">
               <img src="{{img}}" alt="" data-preview-src="" data-preview-group="{{i}}"/>
           </div>
          {{/each}}
           <p>{{value.title}}</p>
           <h4>{{value.content}}</h4>
       </div>
       <div class="down">
           <ul class="clearfix">

               <li onclick="location.href='./work_job_single.html?partnerId={{value.partnerId}}'">
                   <button>
                       <em></em>
                       <span >约单</span>
                   </button>
               </li>
           </ul>
       </div>

   </li>
{{/each}}
</script>
<script>
    mui.previewImage();
    $(function(){
        //ajax 发送完毕
        $(document).ajaxStop(function(){
            $("#loading").hide();
        });
        //自动轮播
        mui.init({

            swipeBack:true //启用右滑关闭功能
        });
        var slider = mui("#slider");
        slider.slider({
            interval: 2000
        });
        // a链接问题
// 监听tap事件，解决 a标签 不能跳转页面问题
        mui('body').on('tap','a',function(){document.location.href=this.href;});
        //点击选择城市
        $(".city").click(function(){
            location.href="./select_city.html"
        })
        if(localStorage.getItem("city")){
            $(".city").text(localStorage.getItem("city"));
        }
        $("#search").focus(function(){
            location.href='./search_work.html';
        })
        //获取 头像信息
        getAvatar($("#show"));

        //侧边导航栏的用户信息展示
        userInfo($(".header"));
        //获取所有约单信息
        function render(){
            $.ajax({
                //处理session每次不唯一问题
                xhrFields: {
                    withCredentials: true
                },
                type: "post",
                url: baseUrl+"/partner/getAllPartner",
                data:{},
                dataType: 'json',
                success:function(data) {
                    console.log(data);
                    if(data.state==true){
                        template.helper("time",function(date){
                            var time=new Date(date).toLocaleString().replace(/:\d{1,2}$/,' ').substr(5,11).replace("/","-");
                            return time;
                        });

                        template.helper("str",function(str){
                            return str.split(",");
                        });
                    $(".main_content>ul").html(template("work_sigle",data));
                    }else{
                        $("#loading").show();
                        $("#loading>div").text("网络错误，请稍后重试");
                    }

                }

            })

        }
        render();

    })
</script>
</html>